package Atomic;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @Author: QianMo
 * @Date: 2021/11/17 10:00
 * @Description:
 */
public class AtomicIntegerTest {
    public static void main(String[] args) {
        AtomicInteger atomic = new AtomicInteger(1);
        int andIncrement = atomic.getAndIncrement();
        //先返回再增加
        System.out.println(andIncrement);
        System.out.println(atomic.get());


    }
}
